package com.alpha.processor.creators.base;

import com.alpha.processor.processor.tools.ProcessorTool;

import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;

public abstract class CreateModel {
    private ProcessorTool logger;

    private Elements elementUtils;

    private TypeElement classElement;

    public CreateModel(ProcessorTool logger, Elements elementUtils, TypeElement classElement) {
        this.logger = logger;
        this.elementUtils = elementUtils;
        this.classElement = classElement;
    }

    public String getClassName(){
        return classElement.getSimpleName().toString();
    }

    public String getPackageName(){
        PackageElement packageElement = elementUtils.getPackageOf(classElement);
        return packageElement.getQualifiedName().toString();
    }

    public abstract String getGenarateFileName();

    public String getGenerateFileFullName(){
        return getPackageName() + "." + getGenarateFileName();
    }

    public ProcessorTool getLogger() {
        return logger;
    }

    public Elements getElementUtils() {
        return elementUtils;
    }

    public TypeElement getClassElement() {
        return classElement;
    }
}
